package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;

class zof {
   ArrayList a = new ArrayList();
   ArrayList b = new ArrayList();
   ArrayList c = new ArrayList();
   ArrayList d = new ArrayList();
   ArrayList e = new ArrayList();
   HashMap f = new HashMap();
   HashMap g = new HashMap();
   private zok h = null;

   static zof a(zok var0) {
      zof var1 = new zof();
      var1.h = var0;
      var1.a();
      var1.b();
      zbvx var2 = var0.a.getWorksheets().B();
      Style var3 = var2.a(0);
      var3.a(false);
      var1.a(var3, 0);
      var3 = var2.a(15);
      var3.a(true);
      var1.a(var3, 15);

      for(int var4 = 1; var4 < var2.getCount(); ++var4) {
         if (var4 != 15) {
            var3 = var2.a(var4);
            var1.a(var3, var4);
         }
      }

      return var1;
   }

   void a() {
      zon var1 = new zon();
      var1.b = new zqb();
      var1.b.a = "none";
      var1.a = com.aspose.cells.b.a.a.ze.a(this.a, (Object)var1);
      zon var2 = new zon();
      var2.b = new zqb();
      var2.b.a = "gray125";
      var2.a = com.aspose.cells.b.a.a.ze.a(this.a, (Object)var2);
   }

   void b() {
      zno var1 = new zno();
      var1.c = new znp();
      var1.e = new znp();
      var1.b = new znp();
      var1.d = new znp();
      var1.f = new znp();
      var1.a = com.aspose.cells.b.a.a.ze.a(this.b, (Object)var1);
   }

   void a(Style var1, int var2) {
      zqp var3 = new zqp();
      var3.r = var1;
      var3.b = var1.g();
      if (var1.r() != -1 && var1.r() != 0) {
         var3.l = true;
      }

      var3.e = (short)var1.r();
      if (var1.q() != null) {
         var3.f = (short)var1.getFont().j();
         var3.m = true;
      }

      if (var1.getPattern() != 0 || var1.isGradient()) {
         var3.g = this.a(var1);
         var3.n = true;
      }

      if (var1.d() != null) {
         var3.h = this.b(var1);
         var3.o = true;
      }

      var3.c = znl.a(var1);
      if (var3.c != null) {
         var3.p = true;
      }

      var3.d = zqd.b(var1);
      if (var3.d != null) {
         var3.q = true;
      }

      var3.j = (short)var2;
      int var4;
      if (!var1.g()) {
         var4 = com.aspose.cells.b.a.a.ze.a(this.c, (Object)var3);
         var3.a = var4;
         this.g.put(var2, var4);
         if (var2 == 0) {
            this.a(var1, "Normal", var3.a);
         } else if (var1.getName() != null) {
            this.a(var1, var1.getName(), var3.a);
         }
      } else {
         if (var1.h() != 0 && this.g.containsKey(var1.h())) {
            var3.i = com.aspose.cells.a.c.zi.a((Integer)this.g.get(var1.h()));
         }

         var4 = com.aspose.cells.b.a.a.ze.a(this.d, (Object)var3);
         var3.a = var4;
         if (this.h.q) {
            this.f.put(var2, zase.y(var4));
         } else {
            this.f.put(var2, var4);
         }
      }

   }

   void a(Style var1, String var2, int var3) {
      znr var4 = new znr();
      var4.a = var2;
      var4.b = var3;
      com.aspose.cells.b.a.a.ze.a(this.e, (Object)var4);
   }

   private short a(Style var1) {
      if (var1.getPattern() == 0 && !var1.isGradient()) {
         return 0;
      } else {
         zon var2 = zon.a(var1);

         int var3;
         for(var3 = 0; var3 < this.a.size(); ++var3) {
            zon var4 = (zon)this.a.get(var3);
            if (zon.a(var2, var4)) {
               return (short)var4.a;
            }
         }

         var3 = com.aspose.cells.b.a.a.ze.a(this.a, (Object)var2);
         var2.a = var3;
         return (short)var3;
      }
   }

   private short b(Style var1) {
      if (!var1.f()) {
         return 0;
      } else {
         zno var2 = zno.b(var1);

         int var3;
         for(var3 = 0; var3 < this.b.size(); ++var3) {
            zno var4 = (zno)this.b.get(var3);
            if (zno.a(var2, var4)) {
               return (short)var4.a;
            }
         }

         var3 = com.aspose.cells.b.a.a.ze.a(this.b, (Object)var2);
         var2.a = var3;
         return (short)var3;
      }
   }
}
